package com.vtech.ont.file.config;

import com.vtech.ont.base.config.JenaConfiguration;
import org.springframework.context.annotation.Bean;

/**
 * TODO
 *
 * @author houzhiwei
 * @date 2017/7/19 15:40
 */
public class OntFileConfiguration extends JenaConfiguration {

    public static final String DEFAULT_LOCATION_MAPPER = "classpath:/config/ont/location-mapper.ttl";
    public static final String LOCAL_LOCATION_MAPPER = "./src/main/resources/ont-config/location-mapper.ttl";

    @Bean(name = "ontFileSource")
    public OntFileSource ontFileSource() {
        OntFileSource fileSource = new OntFileSource();
        fileSource.setEntryFile(env.getProperty(ONT_FILE_ENTRY));
        fileSource.setLocationMappingFile(env.getProperty(JENA_FILE_LOCATION_MAPPER,
                                                          DEFAULT_LOCATION_MAPPER));
        return fileSource;
    }
}
